<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/global/global-head.jsp" %>
<!DOCTYPE html>
<html lang="zh">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>吉车惠后台管理系统</title>
	<%@include file="/global/global-other.jsp" %>
<script type="text/javascript">
	var $bn_oilStaion_map = new Object();
	var $bn_oilStaion_map_Datagrid;
	var viewDialog_map = null;
	$(function(){
		$("#lng").click(function(){
			openmap();
		});
		$("#lat").click(function(){
			openmap();
		});
	});
	$(function() {
		submitForm = function($dialog,$grid){
			$('#an_car_form').form('submit',{
				url:'${ctx}/bn/oil/insert',
				queryParams:{_m:'exec'},
				onSubmit:function(){
					if($(this).form('enableValidation').form('validate')){
						return true;
					}else{
						return false;
					}
				},
				success:function(data){
					var json = eval("("+data+")");
					if(statusMsg(json)){
						$.messager.alert("提示","保存成功！","info",function(){
							$dialog.dialog('destroy');
							$grid.datagrid('reload');
						});
					}
				}
			});
		};

		<%--$("#provinceCode").combobox({--%>
			<%--onSelect: function () {--%>
				<%--var newPtion = $(this).combobox('getValue');--%>
				<%--if(newPtion == ""){--%>
					<%--return;--%>
				<%--}--%>
				<%--var poststr="provinceCode="+newPtion;--%>
				<%--$.ajax({url:"${ctx}/bn/oil/getCity?_m=showCity",--%>
					<%--type:"post",--%>
					<%--dataType:"json",--%>
					<%--data : poststr,--%>
					<%--cache:false,--%>
					<%--success:getCity,--%>
					<%--async:false--%>
				<%--});--%>
				<%--function getCity(json)--%>
				<%--{--%>
					<%--var cityList = json.msg;--%>
					<%--var jsoncity = jQuery.parseJSON(cityList);--%>
					<%--var jsondata = [];--%>
					<%--for(var i = 0;i<jsoncity.length;i++){--%>
							<%--jsondata.push({ "id": jsoncity[i].code,"text": jsoncity[i].name});--%>
					<%--}--%>
					<%--$("#cityCode").combobox("loadData", jsondata);--%>
					<%--return;--%>
				<%--}--%>

			<%--}--%>
		<%--})--%>


	});
</script>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=E1ec2431e3702cc907807aca57390206"></script>
<script type="text/javascript">

	function openmap(){
		var lng = $("#lng").val();
		var lat = $("#lat").val();
		viewDialog_map=parent.$.dialog({
			title: '查看地图',
			href: '${ctx}/bn/oil/show?_m=showMap&lng='+lng+'&lat='+lat+'&r='+Math.random(),
			width: 1000,
			height: 600,
			//bodyStyle: {overflow: 'auto'},
			buttons: [{
				text: '保 存',
				width:'70px',
				iconCls: 'icon-ok',
				handler: function(){
					viewDialog_map.find('iframe').get(0).contentWindow.submitForm(viewDialog_map,$bn_oilStaion_map);
				}
			},{
				text: '关 闭',
				width:'70px',
				iconCls: 'icon-close',
				handler: function(){
					viewDialog_map.close();
				}
			}]
		});
		parent.$.messager.progress('close');
	}

	$bn_oilStaion_map.setjwd = function(lngX,latY){
		$("#lng").val(lngX);
		$("#lat").val(latY);
	}

</script>
</head>
<body>
<div class="form-box">
	<div class="form-body">
		<form role="form" name="an_car_form" id="an_car_form" class="easyui-form form form-horizontal" data-options="novalidate:true">
			<div class="seg-title">
				<div class="seg-title-box">
					<ul>
						<li class="seg-title-box-icon" ><img src="${ctx }/assets/images/communication.gif"/></li>
						<li class="seg-title-box-text">基本信息</li>
					</ul>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">城市：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text"  id="cityCode" name="cityCode"  class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" data-options="valueField: 'code',textField: 'name',url:'${ctx}/tcode/all/method?method=getCacheCdCity',editable:false" required="required"></input>
				</div>
				<label class="col-sm-2 control-label">
					<p class="label-txt">区/县：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text"  id="countyCode" name="countyCode"  class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" data-options="valueField: 'code',textField: 'name',url:'${ctx}/tcode/all/method?method=getCacheCdCounty',editable:false" required="required"></input>
					<%--<select type="text" id="countyCode" name="countyCode" value="" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;"  required="required" data-options="editable:false,valueField:'id', textField:'text'"></select>--%>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">石油公司：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text"  id="oilCompanyCode" name="oilCompanyCode"  class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" data-options="valueField: 'code',textField: 'name',url:'${ctx}/tcode/all/method?method=getCacheCdOilCompanies',editable:false" required="required"></input>
				</div>
				<label class="col-sm-2 control-label">
					<p class="label-txt">加油站全称：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="oilStationName" name="oilStationName" class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,50]">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">加油站简称：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="oilStationShortName" name="oilStationShortName"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,50]">
				</div>
				<label class="col-sm-2 control-label">
					<p class="label-txt">关键字：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="keyword" name="keyword" class="form-control easyui-combobox" style="width:100%;height:34px;line-height:34px;" required="required" data-options="
                    valueField: 'label',
                    textField: 'value',
                    data: [{
                        label: 'A',
                        value: 'A'
                    },{
                        label: 'B',
                        value: 'B'
                    },{
                        label: 'C',
                        value: 'C'
                    },{
                        label: 'D',
                        value: 'D'
                    },{
                        label: 'E',
                        value: 'E'
                    },{
                        label: 'F',
                        value: 'F'
                    },{
                        label: 'G',
                        value: 'G'
                    },{
                        label: 'H',
                        value: 'H'
                    },{
                        label: 'I',
                        value: 'I'
                    },{
                        label: 'J',
                        value: 'J'
                    },{
                        label: 'K',
                        value: 'K'
                    },{
                        label: 'L',
                        value: 'L'
                    },{
                        label: 'M',
                        value: 'M'
                    },{
                        label: 'N',
                        value: 'N'
                    },{
                        label: 'O',
                        value: 'O'
                    },{
                        label: 'P',
                        value: 'P'
                    },{
                        label: 'Q',
                        value: 'Q'
                    },{
                        label: 'R',
                        value: 'R'
                    },{
                        label: 'S',
                        value: 'S'
                    },{
                        label: 'T',
                        value: 'T'
                    },{
                        label: 'U',
                        value: 'U'
                    },{
                        label: 'V',
                        value: 'V'
                    },{
                        label: 'W',
                        value: 'W'
                    },{
                        label: 'X',
                        value: 'X'
                    },{
                        label: 'Y',
                        value: 'Y'
                    },{
                        label: 'Z',
                        value: 'Z'
                    }
                    ],editable:false" />
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">纬度：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="lat" name="lat"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" readonly="true" validType="length[1,10]" >
				</div>
				<label class="col-sm-2 control-label">
					<p class="label-txt">经度：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="lng" name="lng"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" readonly="true" validType="length[1,10]">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">地址：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="address" name="address"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,50]">
				</div>
				<label class="col-sm-2 control-label">
					<p class="label-txt">erpCode：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="erpCode" name="erpCode"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,20]">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">
					<p class="label-txt">hosCode：</p>
					<p class="star">*</p>
				</label>
				<div class="col-sm-3">
					<input type="text" id="hosCode" name="hosCode"  class="form-control easyui-validatebox" style="width:100%;height:34px;line-height:34px;" required="required" validType="length[1,20]">
				</div>
			</div>
		</form>
	</div>
</div>
</body>
</html>